<%--
    Document   : index
    Created on : Oct 11, 2011, 12:01:14 AM
    Author     : XuanTuan
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>VeriSign Authentication Services - The leading Provider of SSL.
            Products include SSL, SSL Certificates, Extended Validation
            (EV SSL), VeriSign Trust Seal, Malware Scan & Code Signing.</title>
        <link href="styles.css" rel="stylesheet" type="text/css" media="screen" />
        <link rel="stylesheet" href="nivo-slider.css" type="text/css" media="screen" />

        <script type="text/javascript">
            function getStats(fName) {
                fullName = fName;
                shortName = fullName.match(/[^\/\\]+$/);
                document.forms.createcert.filename.value = shortName;
            }
        </script>

        <%
                    String CN = (String) request.getAttribute("CN");
                    String OU = (String) request.getAttribute("OU");
                    String O = (String) request.getAttribute("O");
                    String L = (String) request.getAttribute("L");
                    String C = (String) request.getAttribute("C");
                    String errorCreate = (String) request.getAttribute("errorCreate");

                    CN = (CN == null) ? "" : CN;
                    OU = (OU == null) ? "" : OU;
                    O = (O == null) ? "" : O;
                    L = (L == null) ? "" : L;
                    C = (C == null) ? "" : C;
                    errorCreate = (errorCreate == null) ? "" : errorCreate;
        %>
    </head>
    <body>
        <div id="content">
            <div class="header_text">
                <div id="logo" >
                    <img src="images/verisignLogo.gif"/>
                </div>
            </div>
            <div id="back">
                <!-- header begins -->
                <div id="header">
                    <%@ include file="header.jsp" %>
                </div><!-- header ends -->

                <!-- content begins -->
                <div id="main">
                    <div id="right">

                        <%
                                    String user2 = (String) session.getAttribute("user");
                                    if (user2 != null) {
                        %>
                        <h1>Create Certificate</h1>
                        <br/><br/>
                        <form name="createcert" action="CreateCertControl" method="post" enctype="multipart/form-data">
                            <table cellspacing="10" style="font-size: 1.3em;">
                                <th colspan="2"><h3>Certificate information</h3></th>
                                <tr>
                                    <td>Version: </td>
                                    <td>3</td>
                                </tr>
                                <tr>
                                    <td>Signature algorithm: </td>
                                    <td>MD5 with RSA</td>
                                </tr>
                                <tr>
                                    <td>Key size: </td>
                                    <td>1024</td>
                                </tr>

                                <th colspan="2"><h3>Issuer Information</h3></th>
                                <tr>
                                    <td>Common name: </td>
                                    <td>VeriSign</td>
                                </tr>
                                <tr>
                                    <td>Organizational unit: </td>
                                    <td>JavaSoft</td>
                                </tr>
                                <tr>
                                    <td>Organization: </td>
                                    <td>Sun Microsystems</td>
                                </tr>
                                <tr>
                                    <td>Country: </td>
                                    <td>United States</td>
                                </tr>

                                <th colspan="2">
                                    <h3>Your Information</h3>
                                    <h4><font color="red"> <%=errorCreate%> </font></h4>
                                </th>
                                <tr>
                                    <td>Common name: </td>
                                    <td><input type="text" name="CN" value="<%=CN%>"/></td>
                                </tr>
                                <tr>
                                    <td>Organizational unit: </td>
                                    <td><input type="text" name="OU" value="<%=OU%>"/></td>
                                </tr>
                                <tr>
                                    <td>Organization: </td>
                                    <td><input type="text" name="O" value="<%=O%>"/></td>
                                </tr>
                                <tr>
                                    <td>Locality: </td>
                                    <td><input type="text" name="L" value="<%=L%>"/></td>
                                </tr>
                                <tr>
                                    <td>Country: </td>
                                    <td><input type="text" name="C" value="<%=C%>"/></td>
                                </tr>
                                <tr>
                                    <td>Your public key: </td>
                                    <td><input type="file" name="PubK" onchange="getStats(this.value)"/>
                                        <input type="hidden" name="filename">
                                    </td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td><input type="submit" value="Submit"></td>
                                </tr>
                            </table>
                        </form>
                        <%} else {
                        %>
                        <h1>Please login to use this feature!</h1>
                        <%            }
                        %>


                    </div>

                    <div id="left">
                        <%@include file="leftPanel.jsp" %>
                    </div>
                </div><!--content ends -->

                <!--footer begins -->
                <div id="footer">
                    <p>Copyright  2011.Design by Nguyen Xuan Tuan</p>
                </div>
                <div style="clear: both"></div>
            </div>

        </div>
        <!-- footer ends-->
    </body>
</html>

